<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		#nav li{
			display: inline;
			margin: 5px;
		}
	</style>
</head>
<body>
	<script>
	// 用排序做
	// function s(a,b){
	// 	return a-b
	// }
	// arr = arr.sort(s);
	// console.log('最小值'+arr[0]);
	// console.log('最大值'+arr.slice(-1));
	// 用循环做
	var arr = [5,8,6,69,51,23,3,7,2,9,27,16,75,32,48];
	var min = arr[0];
	var max = arr[0];
	for(var i=1;i<arr.length;i++){
		if(min>arr[i]){
			min = arr[i];
		}
		if(max<arr[i]){
			max=arr[i]
		}
	}
	console.log('最小值'+min);
	console.log('最大值'+max); 
	</script>
</body>
</html>